package pms.common.utils;

import pms.common.value.UserSessionValue;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

public class SessionUtil {
	static public int getUserId() {
		HttpServletRequest l_request= ServletActionContext.getRequest();
        HttpSession l_session = l_request.getSession(true);
        UserSessionValue usv = (UserSessionValue)l_session.getAttribute(Consts.USER_SESSION_KEY);
		return usv.getUserId();
	}
	static public UserSessionValue getUserValue() {
		HttpServletRequest l_request= ServletActionContext.getRequest();
        HttpSession l_session = l_request.getSession(true);
        UserSessionValue usv = (UserSessionValue)l_session.getAttribute(Consts.USER_SESSION_KEY);
		return usv;
	}
}
